package com.ys.service.sys.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.ys.entity.sys.ToaNotice;
import com.ys.mapper.sys.ToaNoticeMapper;
import com.ys.service.sys.ToaNoticeService;
import com.ys.vo.R;

@Service("toaNoticeService")
public class ToaNoticeImpl implements ToaNoticeService {

    @Autowired
    private ToaNoticeMapper toaNoticeMapper;

    @Override
    public R add(Map<String, Object> params) {

    	ToaNotice entity = JSON.parseObject(JSON.toJSONString(params), ToaNotice.class);

        toaNoticeMapper.insert(entity);
        return R.ok();

    }

    @Override
    public R edit(Map<String, Object> params) {

    	ToaNotice entity = JSON.parseObject(JSON.toJSONString(params), ToaNotice.class);

        toaNoticeMapper.update(entity);
        return R.ok();

    }
}
